package com.zkl.push.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zkl.push.model.WxopenSubscriptionMessage;
import com.zkl.push.mapper.WxopenSubscriptionMessageMapper;
import com.zkl.push.service.WxopenSubscriptionMessageService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.apache.commons.lang3.StringUtils;

import java.util.List;
/**
 * <p>
 * 订阅消息表 服务实现类
 * </p>
 *
 * @author gongxz
 * @since 2020-01-06
 */
@Service
@Transactional
public class WxopenSubscriptionMessageServiceImpl extends ServiceImpl<WxopenSubscriptionMessageMapper, WxopenSubscriptionMessage> implements WxopenSubscriptionMessageService {

    @Autowired
    private WxopenSubscriptionMessageMapper wxopenSubscriptionMessageMapper;

    @Override
    public IPage<WxopenSubscriptionMessage> selectPage(Page<WxopenSubscriptionMessage> page, WxopenSubscriptionMessage wxopenSubscriptionMessage) {
        QueryWrapper<WxopenSubscriptionMessage> queryWrapper = new QueryWrapper<WxopenSubscriptionMessage>();
        getQueryWrapper(queryWrapper,wxopenSubscriptionMessage);
        return wxopenSubscriptionMessageMapper.selectPage(page,queryWrapper);
    }

    @Override
    public List<WxopenSubscriptionMessage> selectList(WxopenSubscriptionMessage wxopenSubscriptionMessage) {
        QueryWrapper<WxopenSubscriptionMessage> queryWrapper = new QueryWrapper<WxopenSubscriptionMessage>();
        getQueryWrapper(queryWrapper,wxopenSubscriptionMessage);
        return wxopenSubscriptionMessageMapper.selectList(queryWrapper);
    }

    /**
     *  公共查询条件
     * @param queryWrapper
     * @return
     */
    public QueryWrapper<WxopenSubscriptionMessage> getQueryWrapper(QueryWrapper<WxopenSubscriptionMessage> queryWrapper,WxopenSubscriptionMessage wxopenSubscriptionMessage){
        //条件拼接
    
        return queryWrapper;
    }
}
